<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ModifyWorkOrderCity extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasColumn('work_order', 'country_code')) {
            Schema::table('work_order', function (Blueprint $table) {
                $table->string('country_code')->after('country_id')->default('')->comment('国家code');
                $table->string('province_code')->after('province_id')->default('')->comment('省份code');
                $table->string('city_code')->after('city_id')->default('')->comment('城市code');
                $table->string('county_code')->after('county_id')->default('')->comment('区县code');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
